﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>错题统计</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../static/css/font.css">
    <link rel="stylesheet" href="../../../static/css/weadmin.css">
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <div class="weadmin-nav">
        <span class="layui-breadcrumb" style="visibility: visible;">
            <a href="#">首页</a><span lay-separator="">/</span>
            <a href="#">考试结果查询</a><span lay-separator="">/</span>
            <a><cite>错题统计</cite></a>
        </span>
        <a class="layui-btn layui-btn-sm" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
            <i class="layui-icon" style="line-height:30px">&#x1002;</i>
        </a>
    </div>
    <div class="weadmin-body">
        <table id="datalist" lay-filter="datalist"></table>
    </div>
    <script src="../../../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/html" id="tool">
        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
    </script>
    <script>
        layui.use(['table', 'jquery'], function () {
            var table = layui.table,
                $ = layui.jquery;
            $.support.cors = true;
            $.ajaxSetup({
                cache: false,
                headers: {
                    "userid": JSON.parse(window.localStorage.authInfo).UserId,
                    "signtoken": JSON.parse(window.localStorage.authInfo).SignToken,
                },
            })
            table.render({
                id: "datalist",
                elem: '#datalist',
                url: ApiUrl + 'ExamSearch/GetQuestionErrorListPage', //数据接口,
                //where: { swhere: swhere },
                cellMinWidth: 80,
                //toolbar: "#toolbar",
                cols: [
                    [
                        { field: 'Row', title: '序号', width: 60 },
                        { field: 'EQID', title: '试题编号', width: 100 },
                        { field: 'ErrorCount', title: '错误次数', width: 100 },
                        { field: 'ETName', title: '试题类型', width: 100 },
                        { field: 'KKName', title: '知识点' },
                        { field: 'EQContent', title: '问题' },
                        { field: 'EQAnswer', title: '答案' },
                        { field: 'EQScore', title: '试题分数', width: 100 },
                        { fixed: 'right', title: '操作', align: 'center', toolbar: '#tool', width: 80, }
                    ]
                ],
                parseData: function (res) { //res 即为原始返回的数据
                    return {
                        "code": res.StatusCode, //解析接口状态
                        "msg": res.Info, //解析提示文本
                        "count": res.Count, //解析数据长度
                        "data": res.Data //解析数据列表
                    };
                },
                response: { statusCode: 200 },//规定成功的状态码，默认：0
                event: true,
                page: true
            });

            //监听工具条
            table.on('tool(datalist)', function (obj) {
                var data = obj.data;
                var layEvent = obj.event;
                if (layEvent === 'detail') { //查看
                    var detail = layer.open({
                        type: 2,
                        title: "试题信息详情",
                        area: ['700px', '450px'],
                        fixed: false, //不固定
                        maxmin: true,
                        content: '../exam/questionmgr_detail.html?EQID=' + data.EQID,
                    });
                    layer.full(detail);
                }
            });
        });
    </script>
</body>
</html>